#ifndef SimulateBASE_H
#define SimulateBASE_H

#include "circuit.h"
#include <fstream>
#include <list>
#include<stdlib.h>
extern Circuit *C;

class Simulate{
	public:
		~Simulate();
		Simulate(Circuit *C):Ci(C) {}
		
		void initSimulate(void);
		void initSimulate(bool);
		void initSimulateGolden(void);
		void setSigValues(vector<Signal *> sigs, vector<Value> vals);
		void setTraceValues(vector<Value> vals);
		bool sim1cycle(void);
		bool sim1cycleBackward(void);
		bool sim1cycleExh(void);
		void simNcycle(int n);
		void sim_event(bool);
		void sim_event_cycle(void);
		bool sim_event_cycle1(void);
		bool sim_event_back_cycle1(void);
		bool simAllCycle();
		void simNcycleBackward(int n);
		bool simAllCycleBackward();
		void dump(void);
		void dumpOutput(void);
		void forwardSimReg(int n);
		void forwardSim_event(int n);
		void forwardGolden(int n);
		void backwardSimReg(void);
		void setResets(void);
		void simTraced(int cn);
		int computVN(char *filename);
		void initGates(void);

		Signal* getTraced(int i) {return tracedSigs[i];}
		void addTraced(Signal* s) {tracedSigs.push_back(s);}
		int tracedSize(void) {return tracedSigs.size();}

		vector<Node*> passive;
	protected:
                vector<Signal*> tracedSigs;
		vector<Node*> passiveGates;
		Circuit *Ci;
		ofstream dumpFile;
};
#endif
